package adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import bean.ItemBean;
import bean.MyPointBean;
import bean.MyPointDetailBean;
import student.andlei.com.student.R;
import utils.GlideUtils;
import utils.StringUtils;

public class MyPointsAdapter extends BaseQuickAdapter<MyPointDetailBean.My_rank,BaseViewHolder>{

    private Context context;
    public MyPointsAdapter(Context context, int layoutResId, @Nullable List data) {
        super(layoutResId, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, MyPointDetailBean.My_rank item) {
//        helper.getView(R.id.civ_logo);
        GlideUtils.loadImageViewHeadphotoLoding(context,item.head_image, (ImageView) helper.getView(R.id.civ_logo));
        helper.setText(R.id.tv_name, StringUtils.isNull(item.student_name)?"-":item.student_name);
        helper.setText(R.id.tv_ranking, item.rownum+"");
        helper.setText(R.id.tv_points, item.score+"");

    }


}
